package org.farng.mp3.id3;

import org.farng.mp3.InvalidTagException;
import org.farng.mp3.object.ObjectNumberHashMap;
import org.farng.mp3.object.ObjectNumberVariableLength;

import java.io.IOException;


/**
 * Title: Description: Copyright:    Copyright (c) 2002 Company:
 *
 * @author Eric Farng
 * @version $Revision: 1.3 $
 */
public class FrameBodyPOSS extends AbstractID3v2FrameBody {
    /**
     * Creates a new FrameBodyPOSS object.
     */
    public FrameBodyPOSS() {
        //        this.setObject(ObjectNumberHashMap.TIME_STAMP_FORMAT, new Byte((byte) 0));
        //        this.setObject("Position", new Long(0));
    }

    public FrameBodyPOSS(FrameBodyPOSS body) {
        super(body);
    }

    /**
     * Creates a new FrameBodyPOSS object.
     *
     * @param timeStampFormat DOCUMENT ME!
     * @param position DOCUMENT ME!
     */
    public FrameBodyPOSS(byte timeStampFormat, long position) {
        this.setObject(ObjectNumberHashMap.TIME_STAMP_FORMAT, new Byte(timeStampFormat));
        this.setObject("Position", new Long(position));
    }

    /**
     * Creates a new FrameBodyPOSS object.
     *
     * @param file DOCUMENT ME!
     *
     * @throws IOException DOCUMENT ME!
     * @throws InvalidTagException DOCUMENT ME!
     */
    public FrameBodyPOSS(java.io.RandomAccessFile file)
                  throws IOException, InvalidTagException {
        this.read(file);
    }

    /**
     * DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public String getIdentifier() {
        return "POSS";
    }

    /**
     * DOCUMENT ME!
     */
    protected void setupObjectList() {
        objectList.add(new ObjectNumberHashMap(ObjectNumberHashMap.TIME_STAMP_FORMAT, 1));
        objectList.add(new ObjectNumberVariableLength("Position", 1));
    }
}